﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;

namespace Itfort.Install
{
	/// <summary>
	/// 
	/// </summary>
	public class ServiceUtil
	{
		/// <summary>
		/// 
		/// </summary>
		/// <param name="serviceName"></param>
		/// <returns></returns>
		public static ServiceController LookupService(string serviceName)
		{
			ServiceController[] services = ServiceController.GetServices();
			foreach (ServiceController sc in services)
			{
				if (sc.ServiceName.ToLower() == serviceName.ToLower())
				{
					return sc;
				}
			}
			return null;
		}
	}
}
